package pe.com.certicom.moviles.model.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import pe.com.certicom.moviles.model.beans.ReparacionArticuloExample;
import pe.com.certicom.moviles.model.beans.ReparacionArticuloKey;

import com.ibatis.sqlmap.client.SqlMapClient;


@Repository
public class ReparacionArticuloDAOImpl extends SqlMapClientDaoSupport implements ReparacionArticuloDAO {

	
	@Autowired
	public void createSqlMapClient(SqlMapClient sqlMapClient){
	   setSqlMapClient(sqlMapClient);
	}
	
    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public ReparacionArticuloDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public int countByExample(ReparacionArticuloExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("reparacion_articulo.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public int deleteByExample(ReparacionArticuloExample example) {
        int rows = getSqlMapClientTemplate().delete("reparacion_articulo.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public int deleteByPrimaryKey(ReparacionArticuloKey key) {
        int rows = getSqlMapClientTemplate().delete("reparacion_articulo.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public void insert(ReparacionArticuloKey record) {
        getSqlMapClientTemplate().insert("reparacion_articulo.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public void insertSelective(ReparacionArticuloKey record) {
        getSqlMapClientTemplate().insert("reparacion_articulo.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    @SuppressWarnings("unchecked")
    public List<ReparacionArticuloKey> selectByExample(ReparacionArticuloExample example) {
        List<ReparacionArticuloKey> list = getSqlMapClientTemplate().queryForList("reparacion_articulo.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public int updateByExampleSelective(ReparacionArticuloKey record, ReparacionArticuloExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("reparacion_articulo.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    public int updateByExample(ReparacionArticuloKey record, ReparacionArticuloExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("reparacion_articulo.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table reparacion_articulo
     *
     * @ibatorgenerated Thu Mar 07 10:03:19 COT 2013
     */
    private static class UpdateByExampleParms extends ReparacionArticuloExample {
        private Object record;

        public UpdateByExampleParms(Object record, ReparacionArticuloExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}